package com.xiashitech.agent.instrumentation.base.propagator;

import com.xiashitech.agent.instrumentation.base.context.XSContext;
import io.opentelemetry.javaagent.shaded.io.opentelemetry.context.propagation.TextMapGetter;
import io.opentelemetry.javaagent.shaded.io.opentelemetry.context.propagation.TextMapSetter;

import javax.annotation.Nullable;
import javax.annotation.concurrent.ThreadSafe;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;

@ThreadSafe
public interface ReentryTextMapPropagator {

    static ReentryTextMapPropagator noop() {
        return NoopReentryTextMapPropagator.getInstance();
    }

    Collection<String> fields();

    <C> void inject(XSContext context, @Nullable C carrier, TextMapSetter<C> setter);

    <C> XSContext extract(XSContext context, @Nullable C carrier, TextMapGetter<C> getter);
}
